package com.baylor.server.business.common;

import com.baylor.server.business.common.ResponseObject;

public abstract class CustomException extends Exception {

    private static final long serialVersionUID = 1L;

    protected int errorCode;

    protected ResponseObject response;

    protected CustomException() {
        super();
    }

    protected CustomException(String errorMsg) {
        super(errorMsg);
    }

    protected CustomException(int errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
    }

    protected CustomException(int errorCode, String errorMsg, ResponseObject response) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.response = response;
    }

    protected CustomException(String errorMsg, Throwable cause) {
        super(errorMsg, cause);
    }

    protected CustomException(int errorCode, String errorMsg, Throwable cause) {
        super(errorMsg, cause);
        this.errorCode = errorCode;
    }

    protected CustomException(int errorCode, String errorMsg, ResponseObject response, Throwable cause) {
        super(errorMsg, cause);
        this.errorCode = errorCode;
        this.response = response;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public ResponseObject getResponse() {
        return response;
    }

    public void setResponse(ResponseObject response) {
        this.response = response;
    }
}
